﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System.Collections;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using Sebarf.Diagnostics.Interfaces;

#endregion

namespace InterLinq.Test.UI {
	/// <summary>
	/// Interaction logic for SumByOrderPositionForm.xaml
	/// </summary>
	public partial class RawProducts : UserControl {
		/// <summary>
		/// creates a new window that displays products in a raw view
		/// </summary>
		/// <param name="products">to be displayed</param>
		/// <param name="title">title of window</param>
		public RawProducts(IList<IProduct> products, string title) {
			Check.ArgumentNotNull(products, "products");
			Check.ArgumentNotNull(title, "title");
			InitializeComponent();
			m_title.Content = title;
			m_viewRaw.ItemsSource = products;
		}

		private void Button_Click(object sender, RoutedEventArgs e) {
			IEnumerable src = m_viewRaw.ItemsSource;
			m_viewRaw.ItemsSource = null;
			m_viewRaw.ItemsSource = src;
		}
	}
}